#include <stdio.h>
int main()
{
    int shi,fen,miao,sum;

    printf("Input : shi:fen:miao\n");

    scanf("%d:%d:%d",&shi,&fen,&miao);

    sum=shi*3600+fen*60+miao;

    printf("%d",sum);



    return 0;
}
